import { defineStore  } from 'pinia'
import { contantRoutres } from '@/router'
import { RouteRecordRaw } from 'vue-router'
export const useMenuStore = defineStore('menu', {
  // other options...
  state() {
    return {
      // 先以静态路由作为菜单数据的初始值
      menuList:[...contantRoutres] ,
    }
  },
  actions:{
    //发送登录请求
    setMenuList(asyncRoutes:Array<RouteRecordRaw>){
      this.menuList=[...contantRoutres,...asyncRoutes]
    },
  },
})